package com.example.demo.day.config.learn.design.proxy.p1;

//代理
public class Proxy {

    private RealSubject realSubject;

    public void Request() {
        if (realSubject == null) {
            realSubject = new RealSubject();
        }
        preRequest();
        realSubject.Request();
        postRequest();
    }

    public void preRequest() {
        System.out.println("访问真实主题之前的预处理");
    }

    public void postRequest() {
        System.out.println("访问真实主题之后的后续处理");
    }
}
